﻿<Page
    x:Name="PageRoot"
    x:Class="PlayToExample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Horizontal scrolling grid -->
        <Grid Grid.Row="1">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top">
                <Button Click="HandleVideoButtonClicked" Width="256" Margin="20">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="Assets/Video-Camera.png" />
                            <TextBlock Text="Video" HorizontalAlignment="Center" Style="{StaticResource SubheaderTextBlockStyle}" Margin="10"/>
                        </StackPanel>
                    </Button.Content>
                </Button>
                <Button Click="HandlePicturesButtonClicked" Width="256" Margin="20">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="Assets/Camera.png" />
                            <TextBlock Text="Images" HorizontalAlignment="Center" Style="{StaticResource SubheaderTextBlockStyle}" Margin="10"/>
                        </StackPanel>
                    </Button.Content>
                </Button>
                <Button Click="HandleReceiverButtonClicked" Width="256" Margin="20">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="Assets/Media-Play-01.png" />
                            <TextBlock Text="Receiver" HorizontalAlignment="Center" Style="{StaticResource SubheaderTextBlockStyle}" Margin="10"/>
                        </StackPanel>
                    </Button.Content>
                </Button>
            </StackPanel>
        </Grid>
        
        <!-- Back button and page title -->
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="BackButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
                        Style="{StaticResource NavigationBackButtonNormalStyle}"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="PageTitle" Text="{StaticResource AppName}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
        </Grid>
    </Grid>
</Page>
